import request from '@/utils/request'
const api_name = 'vue-admin-template/house'
export default {
  updateAudit(houseId) {
    return request({
      url: `${api_name}/updateHaudit`,
      method: 'post',
      params: { houseId: houseId }
    })
  },
  getAuditList() {
    return request({
      url: `${api_name}/findByHaudit`,
      method: 'get'
    })
  },
  getUserList(page, limit, searchObj) {
    return request({
      url: `${api_name}/${page}/${limit}`,
      method: 'get',
      params: searchObj
    })
  },
  save(user) {
    return request({
      url: `${api_name}/addUser`,
      method: 'post',
      params: user
    })
  },
  adminLogin(path, admin) {
    return request({
      url: `${api_name}/${path}`,
      method: 'post',
      params: admin
    })
  },
  getPageList(page, limit, searchObj) {
    return request({
      url: `${api_name}/${page}/${limit}`,
      method: 'get',
      params: { username: searchObj.name }
    })
  },
  updateUserPermission(permis, userId) {
    return request({
      url: `${api_name}/${userId}`,
      method: 'get',
      params: { permission: permis }
    })
  },
  getById(id) {
    return request({
      url: `${api_name}/update/${id}`,
      method: 'get'
    })
  },
  updateById(user) {
    return request({
      url: `${api_name}/updateUser`,
      method: 'post',
      params: user
    })
  }
}
